import pandas as pd
from sklearn.feature_selection import f_regression
from sklearn.impute import SimpleImputer
import numpy as np

# dataset = pd.read_csv('../../data/ingotRate.csv')
dataset = pd.read_csv('../../data/yieldRate.csv')

X = dataset.iloc[:, :-1]
y = dataset.iloc[:, dataset.shape[1] - 1]

# 求解特征的重要度F-score, 及对应的p_value
# 按F-score选择属性（>2000)
F_score, p_value = f_regression(X, y)
print(len(F_score))
print(F_score)